#include "widget.h"
#include "ui_widget.h"
#include<QPushButton>
#include<QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
//    QPushButton* button = new QPushButton(this);
//    button->setText("按钮1");
//    button->move(200,300);
//    button->setEnabled(false);
}

Widget::~Widget()
{
    delete ui;
}

//void Widget::handle()
//{
//    qDebug()<<"点击了按钮";
//}


void Widget::on_pushButton_clicked()
{
    qDebug()<<"点击了按钮";
}

void Widget::on_pushButton_2_clicked()
{
    if(ui->pushButton->isEnabled())
    {
        ui->pushButton->setEnabled(false);
    }
    else
    {
        ui->pushButton->setEnabled(true);
    }
}
